extends Control

@onready var continue_button = $MenuContainer/ContinueButton
var save_system: SaveSystem

func _ready():
	save_system = SaveSystem.new()
	add_child(save_system)
	
	# 检查是否有存档文件
	continue_button.disabled = not save_system.has_save_file()

func _on_new_game_button_pressed():
	get_tree().change_scene_to_file("res://scenes/Farm.tscn")

func _on_continue_button_pressed():
	if save_system.has_save_file():
		get_tree().change_scene_to_file("res://scenes/Farm.tscn")

func _on_settings_button_pressed():
	# TODO: 实现设置界面
	print("设置功能待实现")

func _on_quit_button_pressed():
	get_tree().quit()